home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 154 / 154.d81 / knights ex (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  6KB  |  170 lines

  1. 10 poke53280,0:poke53281,10:poke646,0:poke53272,31
  2. 12 dv=peek(186):ifdv<8thendv=8
  3. 20 :
  4. 30 rem  title screen
  5. 40 :
  6. 50 print"[147][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223]";
  7. 60 print"[223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][146]";
  8. 70 print"[169][223]                                    [169][223]";
  9. 80 print"[223][169][146]        [176][176][174][176][174][174][178][176][192][174][176] [174][176][178][174][176][192][174][174]        [169][223][146]";
  10. 90 print"[169][223]        [221][221] [221][221][221][221][221]  [221] [221] [221] [221]           [169][223]";
  11. 100 print"[223][169][146]        [171][177][174][221][221][221][221][221] [174][171][192][179] [221] [173][192][174]         [223][169][146]";
  12. 110 print"[169][223]        [221] [221][221][221][221][221][221] [221][221] [221] [221]   [221]         [169][223]";
  13. 120 print"[223][169][146]        [173] [189][173][173][189][177][173][192][189][173] [189] [177] [173][192][189]         [223][169][146]";
  14. 130 print"[169][223]      [176][192][174][176][174][176][176][192][174][176] [174][176][192][174][176][174][174][176][192][174][176][192][174]      [169][223]";
  15. 140 print"[223][169][146]      [221]   [221][221][221]  [221] [221][221] [221][221][221][221][221]  [221]        [223][169][146]";
  16. 150 print"[169][223]      [171][192] [176][219][189][221]  [171][192][179][171][192][179][221][221][221][221] [174][171][192]       [169][223]";
  17. 160 print"[223][169][146]      [221]  [221][221] [221]  [221] [221][221] [221][221][221][221][221] [221][221]        [223][169][146]";
  18. 170 print"[169][223]      [173][192][189][189][173][189][173][192][189][173] [189][173] [189][173][173][189][173][192][189][173][192][189]      [169][223]";
  19. 180 print"[223][169][146]        [176][192][192][174][176]  [174][176][192][192][174][176][192][192][174][176][192][192][174]        [223][169][146]";
  20. 190 print"[169][223]        [221]   [171][192][192][179][171][192]  [173][192][192][174][173][192][192][174]        [169][223]";
  21. 200 print"[223][169][146]        [173][192][192][189][173]  [189][173][192][192][189][173][192][192][189][173][192][192][189]        [223][169][146]";
  22. 210 print"[169][223]         [176][192][174][176] [174][176][192][174][176][192][174][176]  [176][192][174]         [169][223]";
  23. 220 print"[223][169][146]         [171][192][189][221] [221][176][192][189][176][192][189][221]  [171][192]          [223][169][146]";
  24. 230 print"[169][223]         [173]  [173][192][189][173][192][189][173][192][189][173][192][189][173][192][189]         [169][223]";
  25. 240 print"[223][169][146]                                    [223][169][146]";
  26. 250 print"[169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223]";
  27. 260 print"[223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169]";
  28. 270 fori=1to2:print"                                        [146]";:next
  29. 280 print"                                       [157][148] "
  30. 290 tq=0:poke53370,0
  31. 292 tq=tq+1:geta$:ifa$=""andtq<200then292
  32. 294 poke53371,0
  33. 298 gosub1290
  34. 300 :
  35. 310 rem  instruction screen
  36. 320 :
  37. 330 dv=peek(186):ifdv<8thendv=8
  38. 332 poke53281,10:poke53280,0:s=53248
  39. 334 print"[147][144] [212]o begin, two white knights occupy the"
  40. 340 print" upper corners  while two black knights"
  41. 350 print" occupy the lower corners of a three by"
  42. 360 print" three square gameboard grid."
  43. 370 print"            [176][192][192][192][192][178][192][192][192][192][178][192][192][192][192][174]"
  44. 380 fori=1to3:print"            [221]    [221]    [221]    [221]":next
  45. 390 print"            [171][192][192][192][192][219][192][192][192][192][219][192][192][192][192][179]"
  46. 400 fori=1to3:print"            [221]    [221]    [221]    [221]":next
  47. 410 print"            [171][192][192][192][192][219][192][192][192][192][219][192][192][192][192][179]"
  48. 420 fori=1to3:print"            [221]    [221]    [221]    [221]":next
  49. 430 print"            [173][192][192][192][192][177][192][192][192][192][177][192][192][192][192][189]"
  50. 440 print" [212]he objective is  to end the game with"
  51. 450 print" the corner positions  of the white and"
  52. 460 print" black knights exchanged[144] using only the"
  53. 470 print" nine cells and the knight's chess move.";
  54. 480 pokes+2,132:pokes+3,100:pokes+4,212:pokes+5,100
  55. 490 pokes+6,132:pokes+7,164:pokes+8,212:pokes+9,164
  56. 500 pokes+21,30:print" [208]ress any key to begin.";
  57. 510 geta$:ifa$=""then510
  58. 512 pokes+21,0
  59. 520 :
  60. 530 rem  gameboard screen
  61. 540 :
  62. 550 print"[147]";:poke53281,0:poke53280,10:poke646,10
  63. 560 print"                      [146] [198][210][207][205] [212][207]  [198][210][207][205] [212][207]"
  64. 570 print" [150] [176][192][192][192][192][178][192][192][192][192][178][192][192][192][192][174]    [146]"
  65. 580 print" [150] [221]1   [150][146][221]2   [150][146][221]3   [150][146][221][146]    [146]"
  66. 590 fori=1to2: print" [150] [221]    [150][146][221]    [150][146][221]    [150][146][221]    [146]":next
  67. 600 print" [150] [171][192][192][192][192][219][192][192][192][192][219][192][192][192][192][179]    [146]"
  68. 610 print" [150] [221]4   [150][146][221]5   [150][146][221]6   [150][146][221]    [146]"
  69. 620 fori=1to2: print" [150] [221]    [150][146][221]    [150][146][221]    [150][146][221]    [146]":next
  70. 630 print" [150] [171][192][192][192][192][219][192][192][192][192][219][192][192][192][192][179]    [146]"
  71. 640 print" [150] [221]7   [150][146][221]8   [150][146][221]9   [150][146][221]    [146]"
  72. 650 fori=1to2: print" [150] [221]    [150][146][221]    [150][146][221]    [150][146][221]    [146]":next
  73. 660 print" [150] [173][192][192][192][192][177][192][192][192][192][177][192][192][192][192][189]    [146]"
  74. 670 print"                      [146]"
  75. 680 fori=1to2:print"                      [146]":next
  76. 690 fori=1to6:print"                      [146]":next
  77. 700 print"                                        [146]";
  78. 710 print"                                       [157][148] "
  79. 712 poke214,15:print:print"[150]   [208]ress [209] to [209]uit
  80. 720 :
  81. 730 [143]  sprite positioning
  82. 740 :
  83. 750 s[178]53248:[151]s[170]2,52:[151]s[170]3,68:[151]s[170]4,132:[151]s[170]5,68
  84. 760 [151]s[170]6,52:[151]s[170]7,132:[151]s[170]8,132:[151]s[170]9,132
  85. 770 [151]s[170]21,30
  86. 780 :
  87. 790 [143]  set variables
  88. 800 :
  89. 810 [134] t(16),f(16):m[178]1:mp[178]1088:s$[178]"                   "
  90. 820 [129]i[178]1[164]16:[135]n:f(i)[178][181](n[173]10):t(i)[178]n[171]10[172]f(i):[130]
  91. 830 p[178]1747:[141]1140:[153]"cont(NULL)ove (NULL)umber:"
  92. 840 p[178]1984:[141]1140:[153]"def  chr$oal: peek(NULL)atnlen(NULL) on (NULL)op   (NULL)left$right$(NULL)val at peekottom"
  93. 850 [129]i[178]1[164]9:c(i)[178]0:[130]:c(1)[178]1:c(3)[178]2:c(7)[178]3:c(9)[178]4
  94. 860 [129]i[178]1[164]7[169]3:x(i)[178]52:x(i[170]1)[178]92:x(i[170]2)[178]132:[130]
  95. 870 [129]i[178]1[164]3:y(i)[178]68:y(i[170]3)[178]100:y(i[170]6)[178]132:[130]
  96. 880 :
  97. 890 [143]  input move
  98. 900 :
  99. 910 p[178]1759:[141]1140:[153]""m
  100. 920 [151]198,0:p[178]1784:[141]1140:[153]s$;:p[178]1824:[141]1140:[153]s$;
  101. 930 p[178]1788:[141]1140:[153]"cont(NULL)ove ascrom:  cmd";:[141]1210:f$[178]g$
  102. 940 f[178][197](f$):[139]f[179]1[176]f[177]9[167]1010
  103. 950 [151]198,0:p[178]1824:[141]1140:[153]s$;
  104. 960 p[178]1829:[141]1140:[153]"cont(NULL)ove (NULL)o:  cmd";:[141]1210:t$[178]g$
  105. 970 t[178][197](t$):[139]t[179]1[176]t[177]9[167]1010
  106. 980 [139]c(f)[178]0[176]c(t)[179][177]0[167]1010
  107. 990 [129]i[178]1[164]16:[139]f[178]f(i)[175]t[178]t(i)[167]1030
  108. 1000 [130]i
  109. 1010 p[178]1864:[141]1140:[153]" (NULL)ove (NULL)ot (NULL)ossible!";:[129]i[178]1[164]2000:[130]
  110. 1020 [141]1140:[153]s$;:[137]920
  111. 1030 p[178]mp:[141]1140:[153]f" "t:m[178]m[170]1:mp[178]mp[170]40:[139]